package com.example.pattern.flyweight;

import lombok.Data;

/**
 * 享元实现类
 *
 * @author FM_南风
 * @date 2024/6/27
 */
@Data
public class FlyweightClass implements FlyweightInterface{
     private final String color; // 颜色
     private int x, y, radius; // 坐标半径

     public FlyweightClass(String color) {
      this.color = color;
     }

     @Override
     public void draw() {
      System.out.println("享元实现类: 绘画 [Color : " + color
              + ", x : " + x + ", y :" + y + ", radius :" + radius);
     }
}
